package com.shopping_assistant.view;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;

public class HomeView extends Activity{
	/** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.home_view);
        
        Button mapBtn = (Button)findViewById(R.id.mapButton);
        mapBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent mapIntent = new Intent(HomeView.this,GoogleMapView.class);
				startActivity(mapIntent);
			}
		});
        
        Button topTenBtn = (Button)findViewById(R.id.topTenButton);
        topTenBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent topTenIntent = new Intent(HomeView.this,TopTenView.class);
				startActivity(topTenIntent);
			}
		});
        
        Button userPrefBtn = (Button)findViewById(R.id.userPreferencesButton);
        userPrefBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent userPreferencesIntent = new Intent(HomeView.this,UserPreferencesView.class);
				startActivity(userPreferencesIntent);
			}
		});
        
        Button logoutBtn = (Button)findViewById(R.id.logoutButton);
        logoutBtn.setOnClickListener(new OnClickListener() {
			public void onClick(View arg0) {
				Intent loginIntent = new Intent(HomeView.this,LoginView.class);
				loginIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
				startActivity(loginIntent);
			}
		});
        
        
        
    }
}
